<?php /* Smarty version 2.6.16, created on 2011-10-28 12:12:23
         compiled from my_game_update.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'html_options', 'my_game_update.tpl', 154, false),)), $this); ?>

 <?php echo '
 <script language="javascript" src="js/contact_us.js"></script> 
<script language="javascript" type="text/javascript">
var j = jQuery.noConflict();
/*j(document).ready(function(){
	getPageId(\'';  echo $this->_tpl_vars['Formval']['game_id'];  echo '\',\'';  echo $this->_tpl_vars['Formval']['ladder_id'];  echo '\',\'';  echo $this->_tpl_vars['Formval']['race_id'];  echo '\',\'';  echo $this->_tpl_vars['Formval']['server_id'];  echo '\');
});

function getPageId(type,id,rid,sid)
{	

	j.ajax({
			type:\'POST\',
			url:\'get_game_info.php\',
			data: \'type=\'+type+\'&id=\'+id+\'&rid=\'+rid+\'&sid=\'+sid,
			dataType:\'json\',
			success:function(jData){
			
				if(jData.flag == 1)
				{
					j(\'#ladder_id_td\').html(jData.html);
					j(\'#race_id_td\').html(jData.html1);
					j(\'#server_id_td\').html(jData.html2);
				}
			},
			error: function(XMLHttpRequest, textStatus, errorThrown){
				j(".contactus-block").html("Some server error occoured. Please report to system administrator.</div>");
			}
		});
}
*/
/*function getChangeGame(id)
{	
	//alert(id);
	j(\'#ladder\').hide();
	j(\'#race\').hide();
	j(\'#region\').hide();
	j(\'#server\').hide();
	j(\'#rating\').hide();
	j.ajax({
			url:\'game_details.php\',
			data: \'id=\'+id,
			type:\'post\',		
			dataType:\'json\',	
		    success:function(resp){
		   //alert(resp.server);
		    if(resp.ladder==\'Y\')
		    {
		   		j(\'#ladder\').show();
			}			
			 if(resp.race==\'Y\')
			 {
				j(\'#race\').show();
			}	
			 if(resp.region==\'Y\')
		   	{
				j(\'#region\').show();				
			}	
			 if(resp.server==\'Y\')
		   	{
				j(\'#server\').show();
			}	
			 if(resp.rating==\'Y\')
		   	{
				j(\'#rating\').show();
			}
				}
		});
}*/

function getChangeGame(id)
{
	$.post(\'game_details.php\',{\'game_id\':id, \'action\':\'get_content\'}, function(data){
		$(\'#dynamic_controls\').html(data);
	});
}
function CheckFields()
{
  if(document.getElementById(\'game_id\').value==\'\' ) 
   {
    $(\'#FormErrorMsg\').show();
    $(\'#FormErrorMsg\').html("Please select a game");
	//$(\'#FormFieldCheckErrorMsg\').fadeOut(2000);
    return false;
   }
   /*if(document.getElementById(\'race_id\').value==\'\' ) 
   {
    $(\'#FormErrorMsg\').show();
    $(\'#FormErrorMsg\').html("Please select a race");
	//$(\'#FormFieldCheckErrorMsg\').fadeOut(2000);
    return false;
   }
   if(document.getElementById(\'ladder_id\').value==\'\' ) 
   {
    $(\'#FormErrorMsg\').show();
    $(\'#FormErrorMsg\').html("Please select a ladder");
	//$(\'#FormFieldCheckErrorMsg\').fadeOut(2000);
    return false;
   }
   if(document.getElementById(\'server_id\').value==\'\' ) 
   {
    $(\'#FormErrorMsg\').show();
    $(\'#FormErrorMsg\').html("Please select a server");
	//$(\'#FormFieldCheckErrorMsg\').fadeOut(2000);
    return false;
   }*/
   
  return true;
 }  
 function keyCheck(eventObj, obj)
{
    var keyCode
 
    // Check For Browser Type
    if (document.all){
        keyCode=eventObj.keyCode
    }
    else{
        keyCode=eventObj.which
    }
 
    var str=obj.value
 
    if(keyCode==46){
        if (str.indexOf(".")>0){
            return false
        }
    }
 
    if((keyCode<46 || keyCode >57)   &&   (keyCode >31)){ // Allow only integers and decimal points
        return false
    }
    
    return true
}
</script>
'; ?>


 <div class="right-panel">
      
        <div class="findstudent-title"><a href="my_game.php"><h1 title="Games"><span>My Games</span></h1></a>
        <div class="breadcrumb"><?php echo $this->_tpl_vars['SubmitButton']; ?>
 Game</div>
        <div class="clear"></div>
		</div>
      <div class="register">
	   <div id='FormErrorMsg' style="color:red; text-align:center; padding-bottom:10px;"><?php if ($this->_tpl_vars['ermsg'] != ''): ?> <?php echo $this->_tpl_vars['ermsg'];  endif; ?> </div>
      <form name="game" id="game" action="" method="post">
	  <input type="hidden" name="user_game_id" value="<?php echo $this->_tpl_vars['user_game_id']; ?>
" />
         <fieldset>
            <label>Select Game :</label>
            <select name="game_id" id="game_id" class="con-req" onchange="getChangeGame(this.value)">
				<option value="">Select</option>
				<?php echo smarty_function_html_options(array('options' => $this->_tpl_vars['GameArr'],'selected' => $this->_tpl_vars['Formval']['game_id']), $this);?>

			</select>
			<label>Active :</label>
			<input name="is_active" id="is_active" type="checkbox" value="Y" <?php if ($this->_tpl_vars['Formval']['is_active'] == ''): ?> checked="checked" <?php else:  if ($this->_tpl_vars['Formval']['is_active'] == 'Y'): ?>checked<?php endif;  endif; ?>>
			<p class="clear"></p>
			<label>Rate ($):</label>
            <input name="rate" id="rate" type="text" value="<?php echo $this->_tpl_vars['Formval']['rate']; ?>
" onkeypress="return keyCheck(event, this);" />
			<p class="clear"></p>
			
			<p id="dynamic_controls">
			<!--THE DYNAMIC CONTROL WILL PRINT HERE - PROSENJIT-->
			<?php echo $this->_tpl_vars['extra_content']; ?>

			</p>
			
			<!--<label id="ladder" <?php if ($this->_tpl_vars['Formval']['is_ladder'] != 'Y'): ?> style='display:none' <?php endif; ?>>Select Ladder :</label>
			<span id="ladder" <?php if ($this->_tpl_vars['Formval']['is_ladder'] != 'Y'): ?> style='display:none' <?php endif; ?>>
            <select name="ladder_id" id="ladder_id" class="con-req">
					<option value="">Select</option>
			</select>
			</span>
            <label id="race" <?php if ($this->_tpl_vars['Formval']['is_race'] != 'Y'): ?> style='display:none' <?php endif; ?>>Select Race :</label>
            <span id="race" <?php if ($this->_tpl_vars['Formval']['is_race'] != 'Y'): ?> style='display:none' <?php endif; ?>>
			<select name="race_id" id="race_id" class="con-req">
					<option value="">Select</option>
			</select>
			</span>
            <p class="clear"></p>
            <label id="server" <?php if ($this->_tpl_vars['Formval']['is_server'] != 'Y'): ?> style='display:none' <?php endif; ?>>Select Server :</label>
			<span id="server" <?php if ($this->_tpl_vars['Formval']['is_server'] != 'Y'): ?> style='display:none' <?php endif; ?>>
            <select name="server_id" id="server_id" class="con-req">
					<option value="">Select</option>
			</select>
			</span>
			<p class="clear"></p>
			<label id="region" <?php if ($this->_tpl_vars['Formval']['is_region'] != 'Y'): ?> style='display:none' <?php endif; ?>>Select Region :</label>
			<span id="region" <?php if ($this->_tpl_vars['Formval']['is_region'] != 'Y'): ?> style='display:none' <?php endif; ?>>
            <select name="ladder_id" id="ladder_id" class="con-req">
					<option value="">Select</option>
			</select>
			</span>
            <label id="rating" <?php if ($this->_tpl_vars['Formval']['is_rating'] != 'Y'): ?> style='display:none' <?php endif; ?>>Select Rating :</label>
            <span id="rating" <?php if ($this->_tpl_vars['Formval']['is_rating'] != 'Y'): ?> style='display:none' <?php endif; ?>>
			<select name="race_id" id="race_id" class="con-req">
					<option value="">Select</option>
			</select>-->
			</span>
            <p class="clear"></p>
            <label>Experience :</label>
            <textarea  name="experience" id="experience"><?php echo $this->_tpl_vars['Formval']['experience']; ?>
</textarea>
            <p class="clear"></p>
           
            <label>&nbsp;</label>
            <input name="submit" class="submit" value="<?php echo $this->_tpl_vars['SubmitButton']; ?>
" type="submit" onclick='return CheckFields()' />
            <input name="" class="cancel" value="Cancel" type="button" onclick="window.location.href='my_game.php'" />
         </fieldset>
      </form>
      </div>
      
      
      
      <div class="clear"></div>
   </div>